<%@page import="Product.ProductVo"%>
<%@page import="java.util.ArrayList"%>
<%@page import="Product.ProductMyba"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("utf-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- bootstrap -->
<link
	href="${pageContext.request.contextPath }/intranet/product/product.css"
	rel="stylesheet">
<%-- <link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/intranet/css/bootstrap.css"> --%>
<script
	src="${pageContext.request.contextPath }/intranet/js/bootstrap.js"></script>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>

<style type="text/css">
.list {
	float: left;
	width: 10%;
	line-height: 30px;
	text-align: center;
	border-bottom: 1px solid #eaeaea;
}
</style>
<script type="text/javascript">
	function getId(id) {
		return document.getElementById(id)
	}
	function goPage(page) {

		var find = $('#find').val();
		var params = "find=" + find;
		params += "&nowPage=" + page;

		$
				.ajax({
					url : '${pageContext.request.contextPath}/intranet/product/list.jsp',
					type : 'POST',
					data : params,
					success : function(html) {

						$('#jax').html(html);
						initialize();

					},
					error : function(request, status, error) {
						alert("실패");
					}
				});
	}
	window.onload = function() {
		search3();
	}
	function FindList() {
		if (event.keyCode == 13) {
			search3();
		}
	}
	function search3() {

		var find = $('#find').val();
		var params = "find=" + find;

		$
				.ajax({
					url : '${pageContext.request.contextPath}/intranet/product/list.jsp',
					type : 'POST',
					data : params,
					success : function(html) {

						$('#jax').html(html);
						initialize();

					},
					error : function(request, status, error) {
						alert("실패");
					}
				});
	}
	function search2() {

		var PD_pback = $('#PD_pback').val();
		var PD_prd = $('#PD_prd').val();
		var PD_max = $('#PD_max').val();
		var PD_yn = $('#PD_yn').val();
		var params = "PD_pback=" + PD_pback;
		params += "&PD_prd=" + PD_prd;
		params += "&PD_max=" + PD_max;
		params += "&PD_yn=" + PD_yn;

		$
				.ajax({
					url : '${pageContext.request.contextPath}/intranet/product/list.jsp',
					type : 'POST',
					data : params,
					success : function(html) {

						$('#jax').html(html);
						initialize();

					},
					error : function(request, status, error) {
						alert("실패");
					}
				});
	}
	function pinsert() {
		location.href = '${pageContext.request.contextPath}/intranet/index.jsp?inc_content=./product/product_insert.jsp';
	}
</script>
</head>
<body>
	<jsp:useBean id="vo" class="Product.ProductVo" />
	<jsp:setProperty property="*" name="vo" />

	<%
		ProductMyba product=new ProductMyba();
			product.setProductvo(vo);
			ArrayList<ProductVo> data=product.list2();
	%>


	<div id="PMain">
		<h1 style="text-align: center;">
			상품 목록<small>Product List</small>
		</h1>
		<div id="PTop" style="margin-top: 30px;" class="panel">

			<!-- Tabs  ================================================== -->


			<div class="bs-example bs-example-tabs">
				<ul id="myTab" class="nav nav-tabs">
					<li class="active"><a href="#home" data-toggle="tab">간편 검색</a></li>
					<li><a href="#profile" data-toggle="tab">상세 검색</a></li>
				</ul>
				<div id="myTabContent" class="tab-content">
					<div class="tab-pane fade in active" id="home">
						<div style="width: 300px; margin: 15px; margin-left: 760px;">
							<div style="width: 240px; display: inline-block;">
								<input type="text" placeholder="상품명을 입력해주세요."
									class="form-control" name='find' id='find'
									onkeypress="FindList()">
							</div>
							<div style="float: right;">
								<input type="button" value="검색" class="btn btn-info"
									onclick="search3()">
							</div>

						</div>

					</div>

					<div class="tab-pane fade" id="profile" style="height: 49px;">
						<div style="margin-left: 455px; margin-top: 15px; width: 700px;">
							사용여부 <select id='PD_yn'>
								<option value=''></option>
								<option value='Y'>Y</option>
								<option value='N'>N</option>
							</select> 상환방법 <select id='PD_pback'>
								<option value='상환'>상환방법</option>
								<option value='원리금균등상환'>원리금균등상환</option>
								<option value='원금균등상환'>원금균등상환</option>
								<option value='원금만기상환'>원금만기상환</option>
							</select> 대출기간<select id='PD_prd'>
								<option value=''>대출기간</option>
								<option value='12개월'>12개월</option>
								<option value='24개월'>24개월</option>
								<option value='36개월'>36개월</option>
							</select> 대출한도 <select id='PD_max'>
								<option value='100000'>대출한도</option>
								<option value='1000'>1,000만원</option>
								<option value='3000'>3,000만원</option>
								<option value='5000'>5,000만원</option>
								<option value='10000'>1억원</option>
							</select> <input type="button" class="btn btn-info" value="검색"
								onclick='search2()'>
						</div>
					</div>

				</div>
			</div>
		</div>

		<div id="jax" style="height: 600px;"></div>
		<div style="float: right"></div>
</body>
</html>